﻿<div class="datagrid-toolbar formToolBar">
    <a href="#" class="easyui-linkbutton" plain="true" onclick="saveFormData()" iconcls="iconfont iconfont-baocun">保存</a>
</div>
<div style="padding:2px;">
    <form id="mf_form" method="post">
        <div id="tb">
            <table cellpadding="0" cellspacing="0" style="width: 100%">
                <tr>
                    <td>
                        <a href="#" class="easyui-linkbutton" onclick="javascript: $('#DefineHomePanel').datagrid('mfInsertRow')" iconcls="iconfont iconfont-jia1" plain="true">增加</a>
                        <a href="#" class="easyui-linkbutton" onclick="javascript: $('#DefineHomePanel').datagrid('mfMoveUp')" iconcls="iconfont iconfont-xiangshang" plain="true">上移</a>
                        <a href="#" class="easyui-linkbutton" onclick="javascript: $('#DefineHomePanel').datagrid('mfMoveDown')" iconcls="iconfont iconfont-paixu" plain="true">下移</a>
                        <a href="#" class="easyui-linkbutton" onclick="javascript: $('#DefineHomePanel').datagrid('mfDeleteRow')" iconcls="iconfont iconfont-shanchu" plain="true">删除</a>
                    </td>
                </tr>
            </table>
        </div>
        <table id="DefineHomePanel" rownumbers="true" fitcolumns="true" striped="true" border="true" idfield="FieldName" singleselect="true" style="height:300px;width:100%"
               autorowheight="false" toolbar="#tb">
            <thead>
                <tr>
                    <th field="Enable" width="50" halign='center' align="center" editor="{type:'checkbox',options:{on:'是',off:'否'}}">
                        是否有效
                    </th>
                    <th field="Title" width="120" halign='center' editor="{type:'validatebox'}">
                        标题
                    </th>
                    <th field="HeaderColor" width="80" halign='center' formatter="HeaderColorFormatter" editor="{type:'combobox',options:{data:headerColor,panelHeight:'auto'}}">
                        窗体头部颜色
                    </th>
                    <th field="Height" width="80" halign='center' editor="{type:'validatebox'}">
                        高度(px)
                    </th>
                    <th field="Border" width="50" halign='center' align="center" editor="{type:'checkbox',options:{on:'是',off:'否'}}">
                        边框
                    </th>
                    <th field="Closable" width="50" halign='center' align="center" editor="{type:'checkbox',options:{on:'是',off:'否'}}">
                        可关闭
                    </th>
                    <th field="Collapsible" width="50" halign='center' align="center" editor="{type:'checkbox',options:{on:'是',off:'否'}}">
                        可折叠
                    </th>
                    <th field="Url" width="200" halign='center' editor="{type:'validatebox'}">
                        链接
                    </th>
                </tr>
            </thead>
        </table>
    </form>
</div>
<script>
    var headerColor = [{ text: '蓝色', value: 'Blue' }, { text: '绿色', value: 'Green' }, { text: '红色', value: 'Red' }, { text: '棕色', value: 'Brown' }];
    function HeaderColorFormatter(value, rowData, rowIndex) {
        if (value == 0) { return; } for (var i = 0; i < headerColor.length; i++)
        { if (headerColor[i].value == value) { return headerColor[i].text; } }
    };
</script>
<script>
    var formId = queryString('formId')
    var fieldName = queryString('fieldName')
    $('#DefineHomePanel').datagrid().datagrid('enableCellEditing');
</script>
